
<?

require_once ("application.list.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;

$indexes = array (
	title=>array (label=>"Title",order=>"DEFAULT",wrapper=>"vmc_icon_message"),
	user=>array (label=>"Message User",order=>"DEFAULT",wrapper=>"vmc_icon_user"),
	target=>array (label=>"Target User",order=>"DEFAULT",wrapper=>"vmc_icon_user"),
	details=>array (label=>"Details",order=>"DEFAULT"),
	cdate=>array (label=>"Create Date",order=>"DEFAULT",wrapper=>"vmc_icon_date"),
);

$object_ctl = "/admin/projects/projects/fs_projects.php?fs_tab=phases&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_phases&fs_action=view&fs_tab_phases=messages&fs_tab_option_phases=fs_messages&phase_id={$_REQUEST["phase_id"]}&";
$link_options = "&fs_tab=phases&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_phases&fs_action=view&fs_tab_phases=messages&phase_id={$_REQUEST["phase_id"]}";
$list_options = array (
	array (
		label=>"Add A Message",
		link=>"fs_projects.php?fs_tab=phases&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_phases&fs_action=view&fs_tab_phases=messages&phase_id={$_REQUEST["phase_id"]}&fs_action_messages=addnew&fs_tab_option_phases=fs_messages",
	),
);

$_OBJECT_IFACE_LIST = _app_create_list_object (array (
                db_conn=>$_GLOBAL_DBH,
                indexes=>$indexes,
		list_count=>"SELECT COUNT(*) FROM project_phase_messages WHERE phase_id={$_REQUEST["phase_id"]}",
		list_select=>"SELECT *,(SELECT CONCAT(last,', ',first) FROM users WHERE users.id=user_id) AS user ,(SELECT CONCAT(last,', ',first) FROM users WHERE users.id=target_id) AS target FROM project_phase_messages WHERE phase_id={$_REQUEST["phase_id"]}",
                list_id=>"lc_project_phase_messages",
                list_options=>$list_options,
                primary_key=>"id",
                primary_relation=>"message_id",
                link_options=>$link_options,
                object_ctl=>$object_ctl
));


$_OBJECT_IFACE_TABBING_PANEL->insert_container ($_OBJECT_IFACE_LIST);

?>
